#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    //connect(ui->pushButton,&QPushButton::clicked,this,&)
   connect(this,&Widget::mySignal,this,&Widget::handleMySignal);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
//    if(windowTitle()=="1")
//    this->setWindowTitle("2");
//    else
//    this->setWindowTitle("1");
    emit mySignal("111111111111111111");

}

void Widget::handleMySignal(const QString&text)
{
    this->setWindowTitle(text);
}







void Widget::on_pushButton_2_clicked()
{
    emit mySignal("22222222222222");

}
